#include "gwbase/base/buffer.h"
#include "gwbase/base/test_harness.h"
#include <boost/bind.hpp>

using namespace dicom;

class BufferTest {};

TEST(BufferTest, Resize) {
  std::vector<char> buf(1024);
  buf.resize(buf.size() * 2);
  buf.resize(buf.size() * 2);
  buf.resize(buf.size() * 2);
  buf.resize(buf.size() * 2);
}

TEST(BufferTest, Append) {
  Buffer buf;
  char data[1024];
  bzero(data, sizeof(data));
  for (int i = 0; i < 10000; ++i) {
    buf.Append(data, 1024);
    if (i % 8 == 0) buf.Skip(buf.size());
  }
}

int main() {
  dicom::RunAllTests();
  return 0;
}
